
using System.Collections;
using Qdb.Foundation;
using Qdb.Internal.Btree;
using Qdb.Internal.Fieldindex;

namespace Qdb.Internal.Fieldindex
{
	internal sealed class IndexedPathIterator : CompositeIterator4
	{
		private IndexedPath _path;

		public IndexedPathIterator(IndexedPath path, IEnumerator iterator) : base(iterator
			)
		{
			_path = path;
		}

		protected override IEnumerator NextIterator(object current)
		{
			FieldIndexKey key = (FieldIndexKey)current;
			return _path.Search(key.ParentID()).Keys();
		}
	}
}
